﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ivan.Dm.ChromeRemoteDebugger.Transport;

namespace Ivan.Dm.ChromeRemoteDebugger.Protocol {
    public static class CommandFactory {
        public static T CreateCommand<T>(Message message) where T : Command {
            T command = JsonHelper.Deserialize<T>(message.Content);
            command.Tool = message.Tool;
            command.Destination = message.Destination;
            return command;
        }
    }
}
